<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<title>File Manager</title>
<script language="javascript" type="text/javascript" src="<{$xoops_url}>/modules/xanhte/js/lib/prototype.js"></script>
<script language="javascript" type="text/javascript" src="<{$xoops_url}>/modules/xanhte/js/lib/tinymce/file_manager/file_manager.js"></script>
<link href="<{$xoops_url}>/modules/xanhte/js/lib/tinymce/file_manager/styles.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
var file_type="<{$form.type}>";
if (file_type!="img" && file_type!="files"){
	alert("<{$smarty.const._MI_XANHTE_FILEMANAGER_INVALID_TYPE}>");
	window.close();
}
fm = new fileManager("<{$app.upload_path}>/<{$app.uid}>","<{$xoops_url}>", "<{$form.file_path}>");
</script>
</head>
<body class="<{$form.type}>Manager">
<h1><{if $form.type=="img"}>Image Manager<{else}>File Manager<{/if}></h1>
<h2>Current Directory</h2>
<img src="<{$xoops_url}>/modules/xanhte/images/common/icon_close.gif" class="pointer right" onclick="window.close();">
<ul class="dirTree">
<{foreach from=$app.dir_tree item=d name=dir_tree}>
	<li><a href="./file_manager.php?file_path=<{$d.path}>&amp;type=<{$form.type}>"><{$d.name}></a><{if !$smarty.foreach.dir_tree.last}>&nbsp;&raquo;<{/if}></li>
<{/foreach}>
</ul>
<ul class="fileList">
<{if $form.file_path}>
	<li><a class="dir" href='?type=<{$form.type}>&amp;file_path=<{$app.parent_dir}>'><img src="./images/folder_large.png" width="32">../</a></li>
<{/if}>	
<{foreach from=$app.file_list.dir item=dir}>
	<li><img src='./images/x.png' class="pointer" onclick="fm.removeFile('<{$dir.name}>',this)" title="remove this folder with lower files."><a class="dir" href='?type=<{$form.type}>&file_path=<{$form.file_path}>/<{$dir.name}>'><img src="./images/folder_large.png" width="32"><{$dir.name}></a></li>
<{/foreach}>
<{foreach from=$app.file_list.file item=file}>
	<li><img src='./images/x.png' class="pointer" onclick="fm.removeFile('<{$file.name}>',this)" title="remove this file.">
	<{if $form.type=="img"}>
		<img src="<{$app.image_prop.upload_path}>/<{$xoops_userid}>/<{$form.file_path}>/<{$file.name}>" width="32" title="<{$file.name}>">
		<{if $file.has_thumb}><img class="pointer" onclick="fm.fileSelect('<{$file.name}>',true);" src="./images/swap_thumb.gif" title="insert thumbnail image"><{/if}>
		<img class="pointer" onclick="fm.fileSelect('<{$file.name}>',false);" src="./images/swap_real.gif" title="insert real image">
	<{else}>
		<span class="pseudoLink" onclick="fm.fileSelect('<{$file.name}>',false);" title="insert this File Link"><img src='<{$xoops_url}>/modules/xanhte/images/common/icon_<{$file.ext|strtolower}>.gif' class="filetypeIcon"><{$file.name}></span>
	<{/if}>
	</li>
<{/foreach}>
</ul>
<div class="uploadform">
	<{if count($errors)>0}>
	<ul class="error">
	<{foreach from=$errors item=e}>
		<li><{$e}></li>
	<{/foreach}>
	</ul>
	<{/if}>
	<form action="./file_manager.php" method="post">
		<{form_input name="create_dir" attr='style="width:120px;"'}>
		<input type="hidden" name="file_path" value="<{$form.file_path}>">
		<input type="hidden" name="type" value="<{$form.type}>">
		<input type="submit" name="action_xanhte_filemanager_createdir" value="Create Folder">
	</form>
	<form action="./file_manager.php" method="post" enctype="multipart/form-data">
		<input type="file" name="upload_file" size="12">
		<input type="hidden" name="file_path" value="<{$form.file_path}>">
		<input type="hidden" name="type" value="<{$form.type}>">
		<input type="submit" name="action_xanhte_filemanager_upload" value="File Upload">
	</form>
</div>
</body>
</html>